package com.ruoyi.back.controller.v3

import com.ruoyi.app.common.Data
import com.ruoyi.app.common.PageData
import com.ruoyi.app.common.pageInfo
import com.ruoyi.back.domain.v3.dto.RecommendRecordSearchDto
import com.ruoyi.back.domain.v3.vo.RecommendNum
import com.ruoyi.back.domain.v3.vo.RecommendRecordListVo
import com.ruoyi.back.service.v3.RecommendService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/system/userRecord")
@Api(tags = ["推荐审核"])
class RecommendRecordController {

    @Autowired
    private lateinit var recommendService: RecommendService


    @ApiOperation("获取推荐作品审核列表")
    @GetMapping("recommendRecordList")
    fun recommendRecordList(recommendRecordSearchDto: RecommendRecordSearchDto): PageData<RecommendRecordListVo> =
        recommendService.recommendRecordList(recommendRecordSearchDto).pageInfo()

    @ApiOperation("推荐记录统计")
    @GetMapping("recommendRecordNum")
    fun recommendRecordNum(): Data<RecommendNum> = recommendService.recommendRecordNum()

    @ApiOperation("审核推荐作品")
    @GetMapping("checkRecommendRecord")
    fun checkRecommendRecord(id: Long, checkType: Int): Data<Boolean> = recommendService.checkRecommendRecord(id, checkType)
}